import { sourcingRequest } from '@api/service/sourcing';
/**
 * 采购类型
**/
// 列表查询
export const queryPurchaseTypeConfigListService = (data, loadingFn) => sourcingRequest({
  url: 'purchaseTypeConfig/list',
  type: 'post',
  data,
  loadingFn
})

// 导出表格数据
export const exportPurchaseTypeConfigListService = (data, loadingFn) => sourcingRequest({
  url: 'purchaseTypeConfig/exportList',
  type: 'post',
  data,
  loadingFn,
  isExport: true
})

// 查询采购类型单据详情 - 根据所选ID
export const queryConfigDetailByIdsService = (data, loadingFn) => sourcingRequest({
  url: 'purchaseTypeConfig/getInfoByIds',
  type: 'post',
  data,
  loadingFn,
})

// 查询采购类型单据详情 - 根据单据ID
export const queryConfigDetailByRecordService = (data, loadingFn) => sourcingRequest({
  url: 'purchaseTypeConfig/getRecordInfoById',
  type: 'get',
  data,
  loadingFn,
})

// 导出采购类型模板
export const exportPurchaseTypeTemplateService = (data, loadingFn) => sourcingRequest({
  url: 'purchaseTypeConfig/exportPurchaseTypeConfigTemplate',
  type: 'post',
  data,
  loadingFn,
  isExport: true
})

// 暂存采购类型配置
export const savePurchaseTypeConfigService = (data, loadingFn) => sourcingRequest({
  url: 'purchaseTypeConfig/saveOrUpdate',
  type: 'post',
  data,
  loadingFn,
})

// 提交采购类型配置
export const submitPurchaseTypeConfigService = (data, loadingFn) => sourcingRequest({
  url: 'purchaseTypeConfig/submit',
  type: 'post',
  data,
  loadingFn,
})

// 待审核列表查询
export const queryConfigAuditListService = (data, loadingFn) => sourcingRequest({
  url: 'purchaseTypeConfig/auditList',
  type: 'post',
  data,
  loadingFn
})

// 待审核 - 删除
export const deleteRecordService = (data, loadingFn) => sourcingRequest({
  url: 'purchaseTypeConfig/deleteRecordInfoById',
  type: 'get',
  data,
  loadingFn
})

// 待审核 - 取回
export const cancelRecordService = (data, loadingFn) => sourcingRequest({
  url: 'purchaseTypeConfig/retrieveRecordById',
  type: 'get',
  data,
  loadingFn
})

// 查询编辑权限
export const queryEditAuthService = (data, loadingFn) => sourcingRequest({
  url: 'purchaseTypeConfig/valEditAuth',
  type: 'post',
  data,
  loadingFn
})
